var fileBrowserDialog = {

    selectedValue : null,

    init : function () {
        // Here goes your code for setting your custom things onLoad.
        // ensure window title in inlinepopups
        var inlinepopups = false;
        for (obj in tinyMCE.selectedInstance.plugins)
            if (tinyMCE.selectedInstance.plugins[obj] == "inlinepopups")
                inlinepopups = true;

        if (inlinepopups)
            tinyMCE.setWindowTitle(window, document.getElementsByTagName("title")[0].innerHTML);
    },

    submit : function () {
        var win = tinyMCEPopup.getWindowArg("window");

        // insert information now
        win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = this.selectedValue;

        // are we an image browser
        if (typeof(win.ImageDialog) != "undefined") {
            // we are, so update image dimensions...
            if (win.ImageDialog.getImageData)
                win.ImageDialog.getImageData();

            // ... and preview if necessary
            if (win.ImageDialog.showPreviewImage)
                win.ImageDialog.showPreviewImage(this.selectedValue);
        }


        // close popup window
        tinyMCEPopup.close();
    },

    cancel : function() {
        tinyMCEPopup.close();
    },

    select : function(path){
        this.selectedValue = path;
    }
};